/*

    tools23d - tools for converting images to 3D formats.
    Copyright (C) 2014  Dave Gorst

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef TOOLS23D_H_INCLUDED
#define TOOLS23D_H_INCLUDED

#ifndef NULL
    #define NULL 0L
#endif

#ifndef BOOL
	#define BOOL unsigned char
#endif

#ifndef TRUE
	#define TRUE 1
#endif
#ifndef FALSE
	#define FALSE 0
#endif

/**
@brief	Order input frames are read in.

Enum detailing whether the frames should be processed start-to-finish,
finish-to-start or alternating between the two.
*/
 
typedef enum
{
	Forwards,	/**<Process frames start-to-finish */
	Backwards,	/**<Process frames finish-to-start */
	Bidirectional	/**<Alternate direction */
} Directions;

/**
@brief	Sort type.

Specify whether we wish to sort input files alphanumerically or by last
file change time (usually meaning file creation time).
*/

typedef enum
{
    Alphanumeric,	/**<Sort alphanumerically */
    Filechangetime	/**<Sort by file change time */
} SortType;


/**
@brief	Colourscheme
*/
typedef enum
{
	Colour = 0,
	Greyscale
} ColourScheme;

/**
@brief	3D output mode.
*/

typedef enum
{
	HSBS,	/**<Half Side-By-Side */
	FSBS,	/**<Full Side-By-Side */
	OU,		/**<Over and Under */
	FHD3D,	/**<Full High Definition 3D */
	ANAGLYPH_RED_BLUE,
	ANAGLYPH_RED_GREEN,
	ANAGLYPH_RED_CYAN
} Mode;

/**
@brief	Options for filtering output images.
*/

typedef enum
{
	Box,		/**<Box, pulse, Fourier window, 1st order (constant) B-Spline */
	Bicubic,	/**<Mitchell and Netravali's two-param cubic filter */
	Bilinear,	/**<Bilinear filter */
	BSpline,	/**<4th order (cubic) B-Spline */
	CatmullRom,	/**<Catmull-Rom spline, Overhauser spline */
	Lanczos3	/**<Lanczos-windowed sinc filter */
} Filters;

/**
@brief	Auto-cropping options.

Specifies whether to crop a full-frame input to widescreen, and if so,
whether we should take the top, middle or bottom part of the picture.
*/

typedef enum
{
	None,	/**<Don't crop output */
	Top,	/**<Take top part of input picture */
	Centre,	/**<Take middle part of input picture */
	Bottom	/**<Take bottom part of input picture */
} AutoCropTypes;

/**
@brief	Log level options.

Options for setting the density of output messages that will be 
generated.
*/

typedef enum
{
	Quiet,		/**<Show only error messages */
	Standard,	/**<Normal operation */
	Verbose		/**<Debug-level output */
} LogLevel;

/* TODO - move this to a ui.h file. */

/**
@brief	Standard return codes

Enum containing the standard return codes used throughout the code.
*/

typedef enum
{
	t3d_success = 0,	/**<Successful */
	t3d_bad_parameter,	/**<Bad input parameter */
	t3d_no_input,		/**<No input received */
	t3d_out_of_memory,	/**<Unable to allocate memory */
	t3d_abort,			/**<User cancelled */
	t3d_operation_failed,	/**<General Failure */
	t3d_displayhelp		/**<User requested help */
} t3d_return;

/** defgroup OPTION_FUNCTIONS CLI option functions
 *
 * @{
 */
#define OPTIONFUNCTION_PROTOTYPE(X) t3d_return X (char, params *, int *, int, char **)
#define OPTIONFUNCTION(X) t3d_return X (char input_char, params * cli_params, int * arg, int argc, char ** argv)
/** @} */

int main (int argc, char * argv []);

void T3D_SetLastError (char *, ...);
char * T3D_ReadLastError (void);
BOOL T3D_CheckForError (void);

#endif

